package A2017;

public class _4_方格分割 {
	static int[][] arr=new int[7][7];
	private static int ans;
	static int[][] direct= {{0,1},{0,-1},{1,0},{-1,0}};
	private static int [][] vis=new int[7][7];
	public static void main(String[] args) {
		f(3,3);
		System.out.println(ans/4);
	}
	private static void f(int i, int j) {
		if(i==0||j==0||i==6||j==6) {
			ans++;
			return;
		}
		vis[i][j]=1;
		vis[6-i][6-j]=1;
		for(int k=0;k<4;k++) {
			int x=i+direct[k][0];
			int y=j+direct[k][1];
			if(x<0||y<0||x>6||y>6) continue;
			if(vis[x][y]==0) {
				f(x,y);
			}
		}
		vis[i][j]=0;
		vis[6-i][6-j]=0;
	}

}
